﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DotNet.Random.Mobile
{
    /// <summary>
    /// 中国电信手机号前缀随机类，实现了接口IIntRandService
    /// </summary>
    public class ChinaTelecomSuffixRandService : Interface.IIntRandService
    {
        /// <summary>
        /// Rands this instance.
        /// 随机生成数字方法
        /// 映射到虚方法中，扩展时，可重写
        /// </summary>
        /// <returns>
        /// 返回int类型
        /// </returns>
        public virtual int Rand()
        {
            var intRand = new Int.IntRandService();
            var serail = ConstUtility.ChinaTelecomPreffix;
            foreach (var item in serail)
            {
                intRand.Serial.Add(item);
            }
            var res = intRand.Rand();
            return res;
        }
    }
}
